<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>par_trajectory_planning: /home/wouter/ros_packages/thp-pj2-08/par_trajectory_planning/include/par_trajectory_planning/steppermotor.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>

<table border="0">
<tr><td valign="top" style="border-right: 1px solid #333; padding-right: 10px;" >
<p>
Project: <a href="http://ros.org/wiki/par_trajectory_planning">par_trajectory_planning</a>
</p>
<p>
License: BSD
</p>
<p>
Dependencies: 
<ul>
  <li>std_msgs</li>
  <li>roscpp</li>
</ul>
</p>
<p>
Used by:
None<br />
</p>
<p>
<a href="../../index.html">All Packages</a>
</p>

</div>
</td><td valign="top" style="padding-left: 10px;" >
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>/home/wouter/ros_packages/thp-pj2-08/par_trajectory_planning/include/par_trajectory_planning/steppermotor.h</h1>  </div>
</div>
<div class="contents">
<a href="steppermotor_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;ros/ros.h&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;<a class="code" href="motor_8h.html">par_trajectory_planning/motor.h</a>&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;<a class="code" href="commands_8h.html">par_trajectory_planning/commands.h</a>&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;modbus/modbus.h&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;cmath&gt;</span>
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef _STEPPERMOTOR_H_</span>
<a name="l00013"></a><a class="code" href="steppermotor_8h.html#a1dbb748b0fb543638d63b54afe8eb1bd">00013</a> <span class="preprocessor"></span><span class="preprocessor">#define _STEPPERMOTOR_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a><a class="code" href="classStepperMotor.html">00015</a> <span class="keyword">class </span><a class="code" href="classStepperMotor.html">StepperMotor</a> : <span class="keyword">public</span> <a class="code" href="classMotor.html">Motor</a>
<a name="l00016"></a>00016 {
<a name="l00017"></a>00017     <span class="keyword">public</span>:
<a name="l00021"></a><a class="code" href="classStepperMotor.html#ada938f512fae66b97c5319fedbc65225">00021</a>             <a class="code" href="classStepperMotor.html#ada938f512fae66b97c5319fedbc65225" title="Constructor.">StepperMotor</a>(modbus_t* cm) { <a class="code" href="classStepperMotor.html#a1f622627c7b054721a3313389cb48ad8">ctx</a> = cm; <a class="code" href="classStepperMotor.html#acb641d6ca4e888da2a941583afc3098b">is_test</a> = <span class="keyword">false</span>; <a class="code" href="classStepperMotor.html#aeaa6702b2fd2d66bf10dd32999f70d8a">stop_motion</a> = <span class="keyword">false</span>; }
<a name="l00025"></a><a class="code" href="classStepperMotor.html#a8654f768f2a8fe44857809f2cdb61812">00025</a>         <span class="keyword">virtual</span> <a class="code" href="classStepperMotor.html#a8654f768f2a8fe44857809f2cdb61812" title="Destructor.">~StepperMotor</a>() { <span class="comment">/*free(ctx);*/</span> }
<a name="l00029"></a>00029         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#aeb9715654c67df9981f2690bf332f897" title="Function for initializing the motor.">init</a>();
<a name="l00033"></a>00033         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#a4b25a3c298a270d4952f13e25bfb8acc" title="Function for starting the motor.">start</a>();
<a name="l00037"></a>00037         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#af0d3c2e75ec64175fefaeeb0914432ff" title="Function for stopping the motor.">stop</a>();
<a name="l00041"></a>00041         <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#ab0bd4fe04741af8b74eaecbce0f1b132" title="Function for initializing communication.">initCom</a>();        
<a name="l00046"></a>00046         <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#a84203d36566a8ce31c35a2655d5dca99" title="Function for configuring single motions.">confSingleMotion</a>(<span class="keyword">const</span> <a class="code" href="structpar__trajectory__planning_1_1commands__.html">par_trajectory_planning::commands</a>&amp; cmd);
<a name="l00051"></a>00051         <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#acfcb85ea01c6274998ae2e2b0a6c17c3" title="Function for configuring PTP motions.">confPTPMotion</a>(<span class="keyword">const</span> <a class="code" href="structpar__trajectory__planning_1_1commands__.html">par_trajectory_planning::commands</a>&amp; cmd);
<a name="l00055"></a>00055         <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#ab34933b2081d2f367700bfc13157a1b2" title="Function for exiting.">exit</a>();
<a name="l00061"></a>00061         uint16_t <a class="code" href="classStepperMotor.html#a4ecd40dfd349c51e29eeb326862984cb" title="Function for converting angles in degrees to motor positions.">angleToStep</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">bool</span>&amp; invalid_motion);
<a name="l00065"></a>00065         <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#a9f9b3d4bf835d5b157c2b9a8f015c87c" title="Function for developing purposes.">test</a>();
<a name="l00066"></a>00066     <span class="keyword">private</span>:
<a name="l00070"></a>00070             <span class="keywordtype">void</span> <a class="code" href="classStepperMotor.html#afe3b8a4013499b95fe9b2f96be809cfe">initSingleMotion</a>(<span class="keywordtype">int</span> slave, uint16_t pos_lo, uint16_t pos_up, 
<a name="l00071"></a>00071                     uint16_t acc_lo, uint16_t acc_up, uint16_t dec_lo, uint16_t dec_up, 
<a name="l00072"></a>00072                     uint16_t speed_lo, uint16_t speed_up, uint16_t operating_mode, uint16_t seq_pos, 
<a name="l00073"></a>00073                     <span class="keywordtype">int</span> off);
<a name="l00074"></a>00074 
<a name="l00075"></a><a class="code" href="classStepperMotor.html#a1f622627c7b054721a3313389cb48ad8">00075</a>         modbus_t* <a class="code" href="classStepperMotor.html#a1f622627c7b054721a3313389cb48ad8">ctx</a>;
<a name="l00076"></a><a class="code" href="classStepperMotor.html#af97e94b64dccbdd2bfea15113aea06dc">00076</a>         <span class="keywordtype">int</span> <a class="code" href="classStepperMotor.html#af97e94b64dccbdd2bfea15113aea06dc">motions</a>;
<a name="l00077"></a><a class="code" href="classStepperMotor.html#ab12d157b9b402915289ce35a2c821141">00077</a>         <span class="keywordtype">int</span> <a class="code" href="classStepperMotor.html#ab12d157b9b402915289ce35a2c821141">repeat_motions</a>;
<a name="l00078"></a><a class="code" href="classStepperMotor.html#acb641d6ca4e888da2a941583afc3098b">00078</a>         <span class="keywordtype">bool</span> <a class="code" href="classStepperMotor.html#acb641d6ca4e888da2a941583afc3098b">is_test</a>;
<a name="l00079"></a><a class="code" href="classStepperMotor.html#aeaa6702b2fd2d66bf10dd32999f70d8a">00079</a>             <span class="keywordtype">bool</span> <a class="code" href="classStepperMotor.html#aeaa6702b2fd2d66bf10dd32999f70d8a">stop_motion</a>;
<a name="l00080"></a>00080 };
<a name="l00081"></a>00081 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
</td></tr></table>

<hr size="1"><div style="align: right;">
<a href="http://ros.org/wiki/par_trajectory_planning">par_trajectory_planning</a><br />
Author(s): Wouter van Teijlingen</br />
<small>autogenerated on Wed Jun 8 2011 17:11:45</small>
</div>
</body>
</html>
